package keer.httpinterface.test.demo;
import keer.httpinterface.annotation.*;
import keer.httpinterface.http.ContentTypes;
import keer.httpinterface.test.DemoInterceptor;
import keer.httpinterface.test.DemoResult;

@HttpInterface(
        url = "http://localhost:8080/demo",
        params = {
                @Param(name = "name1", value = "value1"),
                @Param(name = "name2", value = "value2")
        })
public interface DemoInterface {
    String test = "";

    @Get(url = "/test", interceptors = DemoInterceptor.class)
    DemoResult get(@Arg DemoParam param);

    @Post(url = "/test/{name}")
    DemoResult post(@Arg DemoParam param);

    //    @Post(url = "/test/post/form", contentType = @ContentType(type = "application", subType = "x-www-form-urlencoded"))
    @Post(url = "/test/post/form", contentType = ContentTypes.FORM_URLENCODED)
    DemoResult postForm(@Arg DemoParam param);

    @Post(url = "/test/post/mul", contentType = ContentTypes.MULTIPART_FORM_DATA)
    DemoResult postMultipart(@Arg DemoParam param);

    @Get(params = {
            @Param(name = "name3", value = "value3"),
    })
    void paramMethod(@Arg DemoParam param);
}
